package cn.zwx.member.svc.rpc.facade;

import cn.zwx.base.entity.ResponseEntity;
import cn.zwx.base.exception.BizWrapException;
import cn.zwx.member.svc.rpc.dto.InsertAddressDTO;
import cn.zwx.member.svc.rpc.dto.UpdateAddressDTO;
import cn.zwx.member.svc.rpc.vo.AddressVO;
import org.apache.dubbo.apidocs.annotations.RequestParam;

import java.util.List;

/**
 * @author zhangwenxue
 */
public interface DubboAddressService {


    /**
     * 根据id查询信息
     * @param id 主键id
     * @return ResponseEntity<AddressVO>
     * @throws BizWrapException 业务异常
     */
    ResponseEntity<AddressVO> queryById(@RequestParam(value = "地址id",description = "地址id",required = true) Long id) throws BizWrapException;


    /**
     * 根据id查询信息
     * @param userId 用户id
     * @return AddressEntity
     */
    ResponseEntity<List<AddressVO>> selectByUserId(@RequestParam(value = "用户id",description = "用户id",required = true) String userId);


    /**
     * 新增地址信息
     * @param address 地址请求参数
     * @return 主键id
     * @throws BizWrapException 业务异常
     */
    ResponseEntity<Long> insert(InsertAddressDTO address) throws BizWrapException;

    /**
     * 修改地址信息
     * @param address 地址请求参数
     * @return ResponseEntity<Void>
     * @throws BizWrapException 业务异常
     */
    ResponseEntity<Void> update(UpdateAddressDTO address) throws BizWrapException;

    /**
     * 删除地址信息
     * @param id 地址id
     * @return ResponseEntity<Void>
     */
    ResponseEntity<Void> delete(@RequestParam(value = "地址Id",description = "地址id",required = true) Long id);
}
